//
//  StudentModel.h
//  UADE-Mobile
//
//  Created by Marcos Damian Pianelli on 9/20/11.
//  Copyright (c) 2011 DG. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol StudentLoginDelegate

-(void)didLogin:(id)model;
-(void)didFailLogin:(id)model;

@end 



@protocol StudentGroupDelegate

-(void)didGetGroupInfo:(id)model withError:(NSError*)error;


@end 


@protocol StudentGroupMessageDelegate


-(void)didAddGroupMessage:(id)model withError:(NSError*)error;


@end 



@protocol StudentRecordsDelegate

-(void)didGetStudentRecords:(id)model withError:(NSError*)error;

@end

@protocol StudentMoreInfoDelegate

-(void)didGetMoreStudentInfo:(id)model withError:(NSError*)error;

@end


@protocol StudentVersionCompatibilityDelegate

-(void)didGetVersionInfo:(NSDictionary*)info withError:(NSError*)error;

@end


@interface StudentModel : NSObject{

    NSString * user;
    NSString * password;
    NSString * userHash;
    NSMutableDictionary * recordDic;
    NSMutableArray * records;
    NSMutableDictionary * groupDic;

    NSDate * timestamp;
    
}
@property (nonatomic, strong) NSString * userHash;
@property (nonatomic, strong) NSString * user;
@property (nonatomic, strong) NSString * password;
@property (nonatomic, strong) NSMutableDictionary * recordDic;
@property (nonatomic, strong) NSMutableArray * records;
@property (nonatomic, strong) NSMutableDictionary * groupDic;
@property (nonatomic, strong)  NSDate * timestamp;


+(id)SharedInstance;

-(void)doLogin:(id)delegate user:(NSString*)userName password:(NSString*)pass;
-(void)fetchRecordsWithDelegate:(id)delegate;
-(void)fetchMoreInfoWithDelegate:(id)delegate aulaID:(NSString*)aulaID;
-(void)fetchGroupWithDelegate:(id)delegate aulaID:(NSString*)aulaID;
-(void)fetchGroupWithDelegate:(id)delegate aulaID:(NSString*)aulaID forceFetch:(BOOL)force;
-(void)addGroupMessage:(NSString*)msg toGroup:(NSString*)groupID withDelegate:(id<StudentGroupMessageDelegate>)delegate;
-(void)checkVersionCompatibilityWithDelegate:(id<StudentVersionCompatibilityDelegate>)delegate;



-(void)doLogout;

@end




